package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;
/**
 * 评论点赞
 * @author zdd
 *
 */
@Entity
@Table(name="comment_thumbs")
public class CommentThumbs {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ct_id")
	private Long id;//点赞id
	
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name="ct_time",nullable=false)
	private Date time=new Date();//点赞时间
	
	@OneToOne  
	@JoinColumn(name="ct_user_id")
	private User user;//回复用户
	
	@ManyToOne()
	@JoinColumn(name="ct_dc_id")
	private DiscussComment comment;//对应一个评价

	public CommentThumbs() {}
	
	public User getUser() {
		return user;
	}



	public void setUser(User user) {
		this.user = user;
	}



	public DiscussComment getComment() {
		return comment;
	}



	public void setComment(DiscussComment comment) {
		this.comment = comment;
	}



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Override
	public String toString() {
		return "CommentThumbs [id=" + id + ", time=" + time + "]";
	}
}
